package org.six11.ss.server;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.six11.ss.server.bean.Person;
import org.six11.util.adt.MultiState;

/**
 * 
 * 
 * @author Gabe Johnson <johnsogg@cmu.edu>
 */
public class PlayWebActionHandler extends WebActionHandler {

  /**
   * @param actionName
   * @param jsp
   * @param ms
   */
  public PlayWebActionHandler(String actionName, String jsp, MultiState ms) {
    super(actionName, jsp, ms);
  }

  /**
   * 
   */
  @Override
  public void handle(HttpServletRequest req, HttpServletResponse resp, ServletContext context)
      throws ServletException, IOException {
    // TODO: implement following:
//    String followID = req.getParameter("followID");
//    String nextJsp = jsp;
//    if (ok(followID)) {
//      // the user came in on a link that looks something like this:
//      // http://somehost/ss?a=play_stellasketch&followID=42
//      Person followedPerson = loadPerson(followID);
//      if (followedPerson == null) {
//        req.setAttribute("errorMsg", "Can't find a player with that ID.");
//        nextJsp = "oops.jsp";
//      } else {
//        req.setAttribute("followedPerson", followedPerson);
//        req.setAttribute("online", (followedPerson.getRoom().getId() != RoomHandler.ROOM_OFFLINE));
//      }
//    } else {
//      
//    }
    forwardTo(jsp, req, resp, context);
  }

}
